/****** Object:  Stored Procedure [dbo].spChiTietBienBanKiemKeKhoGet Script Date: 7/16/2012 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[spChiTietBienBanKiemKeKhoGet]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spChiTietBienBanKiemKeKhoGet]
GO

/******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:					Description:
**		--------	--------				-----------------------------------
**		17/07/2012	SongTM					Innit created
*******************************************************************************/

CREATE PROCEDURE [dbo].[spChiTietBienBanKiemKeKhoGet]
(
	@MaBBKKK nvarchar(12),
	@MaLuuKho int
)
WITH ENCRYPTION
AS

SET NOCOUNT ON

SELECT
	[tbl_ChiTietBienBanKiemKeKho].*,
	tbl_LuuKho.SoLo,
	tbl_LuuKho.MaThuoc
FROM [tbl_ChiTietBienBanKiemKeKho] INNER JOIN tbl_LuuKho ON tbl_LuuKho.maLuuKho=[tbl_ChiTietBienBanKiemKeKho].MaLuuKho
	
WHERE
	[MaBBKKK] = @MaBBKKK

	AND [tbl_ChiTietBienBanKiemKeKho].MaLuuKho = @MaLuuKho
GO

--GRANT EXECUTE ON [dbo].[spChiTietBienBanKiemKeKhoGet] TO [sa]
--GO
